<?php 
    $user_id = $this->getHelper('paginationControl')->view->user_id;

    if ($this->pageCount > 1): ?>
<div class="bottom-main">
    <div class="text">Search Events:</div>
    <ul class="paging">
        <!-- Previous page link -->
        <li class="np">
        <?php if (isset($this->previous)): ?>
            <a href="javascript:;" onclick ="<?php 
                switch($this->type_of_data){
                    case 'review': echo "myreviewUpdate( $user_id , ".$this->previous." );pagingUpdate(".$this->previous.",".$user_id.",'".$this->type_of_data."')";
                                   break;
                    case 'rating': echo "myratingUpdate( $user_id , ".$this->previous." );pagingUpdate(".$this->previous.",".$user_id.",'".$this->type_of_data."')";
                                   break;
                    case 'message_inbox': echo "inboxUpdate( ".$this->previous." );pagingUpdate(".$this->previous.",".$user_id.",'".$this->type_of_data."')";
                                   break;           
              
                    case 'message_outbox': echo "outboxUpdate( ".$this->previous." );pagingUpdate(".$this->previous.",".$user_id.",'".$this->type_of_data."')";
                                   break;           
                    default: break;
                } ?>
                ">&lt; Prev.</a>
        <?php else: ?>
            <a href="#">&lt; Prev.</a>
        <?php endif; ?>
        </li>
        
        <?php  foreach ($this->pagesInRange as $page): ?>
            <?php if($page != $this->current): ?>
        <li>
                <a href="javascript:;" onclick ="
                <?php 
                switch($this->type_of_data){
                    case 'review': echo "myreviewUpdate( $user_id , ".$page." );pagingUpdate(".$page.",".$user_id.",'".$this->type_of_data."')";
                                   break;
                    case 'rating': echo "myratingUpdate( $user_id , ".$page." );pagingUpdate(".$page.",".$user_id.",'".$this->type_of_data."')";
                                   break;             
                    case 'message_inbox': echo "inboxUpdate( ".$page." );pagingUpdate(".$page.",".$user_id.",'".$this->type_of_data."')";
                                   break;           
              
                    case 'message_outbox': echo "outboxUpdate( ".$page." );pagingUpdate(".$page.",".$user_id.",'".$this->type_of_data."')";
                                   break;                      
                    default: break;
                } ?>
                ">
                    <?php echo $page; ?>
                </a>
        </li>    
            <?php else: ?>
        <li class="current">
            <span class="first">
                <span class="last">
                    <span class="middle">
                        Page <?php echo $page; ?> 
                    </span>
                </span>
            </span>    
        </li>      
            <?php endif; ?>
        <?php  endforeach; ?>

        <?php if (isset($this->next)): ?>
        <li class="np"> 
            <a href="javascript:;" onclick ="
                <?php 
                switch($this->type_of_data){
                    case 'review': echo "myreviewUpdate( $user_id , ".$this->next." );pagingUpdate(".$this->next.",".$user_id.",'".$this->type_of_data."')";
                                   break;
                    case 'rating': echo "myratingUpdate( $user_id , ".$this->next." );pagingUpdate(".$this->next.",".$user_id.",'".$this->type_of_data."')";
                                   break;             
                    case 'message_inbox': echo "inboxUpdate( ".$this->next." );pagingUpdate(".$this->next.",".$user_id.",'".$this->type_of_data."')";
                                   break;           
              
                    case 'message_outbox': echo "outboxUpdate( ".$this->next." );pagingUpdate(".$this->next.",".$user_id.",'".$this->type_of_data."')";
                                   break;                      
                    default: break;
                } ?>
                ">
            Next &gt;
            </a>
        </li>    
        <?php else: ?>
          <li class="np"> 
            <a href="javascript:;">
            Next &gt;
          </a>
        </li>    
        <?php endif; ?>
    </ul>
    <div class="cf"></div>
</div>
<?php endif; ?>